/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package bean.entity;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author server
 */
@Entity
@Table(name = "Applicants")
@NamedQueries({
    @NamedQuery(name = "Applicants.findAll", query = "SELECT a FROM Applicants a ORDER BY a.appStatus ASC"),
    @NamedQuery(name = "Applicants.findByApplicantID", query = "SELECT a FROM Applicants a WHERE a.applicantID = :applicantID"),
    @NamedQuery(name = "Applicants.findByIDApplicant", query = "SELECT a FROM Applicants a WHERE a.applicantID like ?1"),
    @NamedQuery(name = "Applicants.findByNameApplicant", query = "SELECT a FROM Applicants a WHERE a.applicantName like ?1"),
    @NamedQuery(name = "Applicants.findByApplicantName", query = "SELECT a FROM Applicants a WHERE a.applicantName = :applicantName"),
    @NamedQuery(name = "Applicants.findByAppPhone", query = "SELECT a FROM Applicants a WHERE a.appPhone = :appPhone"),
    @NamedQuery(name = "Applicants.updateStatus", query = "UPDATE  Applicants a set a.appStatus = :status WHERE a.applicantID = :applicantID"),
    @NamedQuery(name = "Applicants.findByAppEmail", query = "SELECT a FROM Applicants a WHERE a.appEmail = :appEmail"),
    @NamedQuery(name = "Applicants.findByDoc", query = "SELECT a FROM Applicants a WHERE a.doc = :doc"),
    @NamedQuery(name = "Applicants.findByAppStatus", query = "SELECT a FROM Applicants a WHERE a.appStatus = :appStatus")})
public class Applicants implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ApplicantID")
    private String applicantID;
    @Basic(optional = false)
    @Column(name = "ApplicantName")
    private String applicantName;
    @Basic(optional = false)
    @Column(name = "AppPhone")
    private String appPhone;
    @Basic(optional = false)
    @Column(name = "AppEmail")
    private String appEmail;
    @Basic(optional = false)
    @Lob
    @Column(name = "AppAbout")
    private String appAbout;
    @Column(name = "DOC")
    @Temporal(TemporalType.TIMESTAMP)
    private Date doc;
    @Basic(optional = false)
    @Column(name = "AppStatus")
    private int appStatus;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "applicants")
    private Collection<Interviews> interviewsCollection;

    public Applicants() {
    }

    public Applicants(String applicantID) {
        this.applicantID = applicantID;
    }

    public Applicants(String applicantID, String applicantName, String appPhone, String appEmail, String appAbout, int appStatus) {
        this.applicantID = applicantID;
        this.applicantName = applicantName;
        this.appPhone = appPhone;
        this.appEmail = appEmail;
        this.appAbout = appAbout;
        this.appStatus = appStatus;
    }

    public String getApplicantID() {
        return applicantID;
    }

    public void setApplicantID(String applicantID) {
        this.applicantID = applicantID;
    }

    public String getApplicantName() {
        return applicantName;
    }

    public void setApplicantName(String applicantName) {
        this.applicantName = applicantName;
    }

    public String getAppPhone() {
        return appPhone;
    }

    public void setAppPhone(String appPhone) {
        this.appPhone = appPhone;
    }

    public String getAppEmail() {
        return appEmail;
    }

    public void setAppEmail(String appEmail) {
        this.appEmail = appEmail;
    }

    public String getAppAbout() {
        return appAbout;
    }

    public void setAppAbout(String appAbout) {
        this.appAbout = appAbout;
    }

    public Date getDoc() {
        return doc;
    }

    public void setDoc(Date doc) {
        this.doc = doc;
    }

    public int getAppStatus() {
        return appStatus;
    }

    public void setAppStatus(int appStatus) {
        this.appStatus = appStatus;
    }

    public Collection<Interviews> getInterviewsCollection() {
        return interviewsCollection;
    }

    public void setInterviewsCollection(Collection<Interviews> interviewsCollection) {
        this.interviewsCollection = interviewsCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (applicantID != null ? applicantID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Applicants)) {
            return false;
        }
        Applicants other = (Applicants) object;
        if ((this.applicantID == null && other.applicantID != null) || (this.applicantID != null && !this.applicantID.equals(other.applicantID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "bean.entity.Applicants[applicantID=" + applicantID + "]";
    }

}
